#!/bin/bash
# Test mass erase
# ./uniflash_linux_64/dslite.sh -c uniflash_linux_64/user_files/configs/cc2640r2f.ccxml -f uniflash_linux_64/ccs_base/arm/FlashLoaderCC26x0.out

BIM_PATH=$(dirname "$PWD")/bim_oad_onchip_cc2640r2lp_app/FlashOnly
PERSIS_PATH=$(dirname "$PWD")/persistent_app_cc2640r2lp/FlashOnly
STATCK_PATH=$(dirname "$PWD")/simple_peripheral_cc2640r2lp_oad_onchip_stack/FlashROM
APP_PATH=$(dirname "$PWD")/simple_peripheral_cc2640r2lp_oad_onchip_app/FlashROM

TPWD=$PWD

cd $BIM_PATH
BIM_HEX=`ls *.hex`
cd $TPWD

cd $PERSIS_PATH
PERSIS_HEX=`ls *.out`
cd $TPWD

cd $STATCK_PATH
STATCK_HEX=`ls *.hex`
cd $TPWD

cd $APP_PATH
APP_OUT=`ls *.hex`
cd $TPWD

cd uniflash_linux_64
. dslite_boarddownload.sh $BIM_PATH/$BIM_HEX  $STATCK_PATH/$STATCK_HEX 
. dslite_boarddownload.sh $PERSIS_PATH/$PERSIS_HEX
# . dslite_boarddownload.sh $APP_PATH/$APP_OUT

# ./merge_flash.sh
# cd uniflash_linux_64
# . dslite_boarddownload.sh ../oad_merge.hex